import type { NotificationType } from 'naive-ui'
import { useNotification } from 'naive-ui'
//封装全局toast
export const toast = (msg: string, type: NotificationType ) => {
  const notification = useNotification();
let title="";

  switch (type) {
    case "info":title='提示';break;
    case "success":title='成功';break;
    case "warning":title='警告';break;
    case "error":title='错误';break;
  }

  notification[type]({
    title: title,
    content: msg,
    duration: 2500,
    keepAliveOnHover: true
  })

};